<?php
session_start();
if (!isset($_SESSION['email'])) {
    header("Location:../../index.php");
}

require '../../conexao.php';

$options_disciplinas = "";
$sql = mysql_query("SELECT * FROM disciplina");
while ($row = mysql_fetch_array($sql)) {
    $options_disciplinas .= "<option value='{$row['id']}'>" . $row['sigla'] . " - " . $row['disciplina'] . "</option>";
}

$combo_professores = "<select id='professor'>";
$sql = mysql_query("SELECT * FROM usuario WHERE tipo='P'");
while ($row = mysql_fetch_array($sql)) {
    $combo_professores .= "<option value='{$row['id']}'>" . $row['nome'] . "</option>";
}
$combo_professores .= "</select>";
?>


<div id="contact" style='margin-right:100px;'>
    <fieldset class="" style="width:700px;margin-top:5%">
        <legend style="font-size:16px;">Cadastrar Orientação</legend>
        <form>
            <h4 style="padding-top: 10px;" >Disciplinas Cursando</h4>
            <select id="disciplina_cursando">
                <?php echo $options_disciplinas ?>
            </select>
            <select id="disciplina_situacao">
                <option value="PP">Vou passar</option>
                <option value="NP">Vou reprovar</option>
                <option value="NS">Não sei</option>
            </select>
            <img src="img/adicionar.png" onclick="adiciona_disciplina_orientacao('cursando')" />
            <div id="orient_disc_cursando"></div>
            <hr />

            <h4 style="padding-top: 10px;">Disciplinas Pretendidas</h4>
            <select id="disciplina_pretendida">
                <?php echo $options_disciplinas ?>
            </select>
            <img src="img/adicionar.png" onclick="adiciona_disciplina_orientacao('pretendida')" />
            <div id="orient_disc_pretendida"></div>
            <hr />

            <h4 style="padding-top: 10px; padding-bottom: 5px;">Professor Responsável</h4>
            <?php echo $combo_professores ?>
            <hr />
            <div style='padding-top: 10px;'>
                <input type="image" src="img/botao_enviar.png" onclick="cadastrar_orientacao()"/>
            </div>
        </form>
    </fieldset>
</div>


